package com.soul.factory;

import com.soul.factory.defaults.RegistFactoryImpl;

/**
 * 抽象工厂，实现需要继承该抽象类
 */
public abstract class RemoteFactory implements Factory {
    
    protected static RegistFactory registFactory = RegistFactoryImpl.getInstance();

    /**
     * 注册当前工厂
     */
    protected RemoteFactory(){
        registFactory.regist(this);
    }

    /**
     * 获取工厂
     * @param name
     * @return
     */
    public static Factory getFactory(String name){
        return registFactory.get(name);
    }
}
